Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where dynamic geometry was not marked as ready #10607

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

ggetz
Copy link
Contributor

@ggetz ggetz commented Jul 28, 2022

Fixes #10517

The above bug was being caused because the bounding sphere was never being computed due to the dynamic geometry never being marked as ready.

This arose after https://github.com/CesiumGS/cesium/pull/10149/files. Previously, when.js would resolve promises synchronously in the same frame. Native promises on the other hand will resolve after a frame. In the case of dynamic geometry, a primitive will have been re-created, so ready always appeared to be false even if the old promise resolved.

Here, instead of waiting on the promise, we check the ready promise synchronously after each frame.

@ggetz ggetz requested a review from sanjeetsuhag July 28, 2022 16:47
@cesium-concierge
Copy link

Thanks for the pull request @ggetz!

  • ✔️ Signed CLA found.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.

Copy link
Contributor

@sanjeetsuhag sanjeetsuhag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that this fixes the issue shown in the Sandcastle in #10517. Thanks @ggetz!

@sanjeetsuhag sanjeetsuhag merged commit af7ba8c into main Jul 28, 2022
@sanjeetsuhag sanjeetsuhag deleted the primitive-ready branch July 28, 2022 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

viewer.zoomTo rectangle failed
3 participants